package com.ttxs.common.core.server;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TomcatConfig {
    @Bean
    @ConditionalOnMissingBean(value = {TomcatServletWebServerFactory.class})
    @ConditionalOnProperty(name = "ttxs.tomcat.disableSession", havingValue = "true", matchIfMissing = true)
    public TomcatFactory tomcatFactory() {
        return new TomcatFactory();
    }
}
